package com.scr1pt.fileshare2.utils

import com.scr1pt.extension.infoLog
import org.slf4j.LoggerFactory
import org.springframework.web.servlet.HandlerInterceptor
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

/**
 * 说明: TODO
 *
 * 创建者: tum0r
 *
 * 时间: 2022/2/4 20:13
 */
class ControllerLog : HandlerInterceptor {
    companion object {
        private val log = LoggerFactory.getLogger(ControllerLog::class.java)
    }

    override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
        log.info("${request.getIP()} -> ${request.servletPath}")
        return true
    }
}